<?php
/**
 * @ Fmash Top System
 * @ version: 3.0
 * @ author: i.coffee.smile@mail.com
 * @ date:2011-1-28
 * @ file:love.php $26
 */
 
include_once 'class_mysql.php';
include_once 'function.php';
include_once 'function_fav.php';

$sid = incheck($_GET['id']);
$uid = incheck($_COOKIE['UID']);
$username = incheck($_COOKIE['Uname']);

if(isset($sid)){
	$getShowinfo = "SELECT `sid`,`name`,`show`,`grade`,`branch`,`dateline`,`hearts` FROM `$top_man` WHERE `sid` = '$sid';";
	$getshows = mysql_query($getShowinfo);
	$info = mysql_fetch_row($getshows);
	$name = $info[1];
	$show = $info[2];
	$grade = $info[3];
	$branch = $info[4];
	$dateline = $info[5];
	$hearts = $info[6];
}

$url = en_now_url();


///得到喜欢这个SID的UID名单
$sql = "SELECT `faveduid` FROM `$top_man_fav` WHERE `sid`='$sid'";
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
if($row[0]==''){
	$empty = 1;
}else{
	$exp_fav = explode("|",$row[0]);
	for($i=0,$favLen=count($exp_fav);$i<$favLen;$i++)
	{
		$expfav = explode(",",$exp_fav[$i]);
		$favArr[] = array('uid'=>$expfav[0],'name'=>$expfav[1]);
		$uidArr[] = $favArr[$i]['uid'];
		$nameArr[] = $favArr[$i]['name'];
	}	
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title><?php echo $name;?> 的个人中心 - 吉首大学网络社区</title>
        <link href="style/mainv.css" media="screen" rel="stylesheet"
        type="text/css" />
        <link href="style/stylev.css" media="screen" rel="stylesheet"
        type="text/css" />
        <style type="text/css">
		img { max-width:140px; }
		img {width:expression(this.width>140?"140px":this.width+"px");}
		</style>
        <link type="image/x-icon" rel="shortcut icon" href="favicon.ico"
        />
    </head>
    
  <body>
<?php include_once("header.template");?>
        <div id="wrapper">
            <div id="wrapper-inner">
                <div id="sidebar">
                    <div class="box userinfo">
                            <img width="140px" height="140px" src="/show/<?php echo $show;?>" />
						<!--<div id="user_heart">
                            <a class="heart hearted" href="/user/193832/do_favx">
                            <span>heart</span>
                            </a>
                            </div>-->
                            <div id="user_heart">
                            <a class="<?php echo heart_q($sid)?>" href="fav.php?sid=<?php echo $_GET['id'];?>">
                            <span>heart</span>
                            </a>
                            </div>
                        <div class="userinfo_blk">
                            <h2>
                                <?php echo $name;?>
                            </h2>
                            年级:<?php echo $grade;?><br>
                            院系:<?php echo $branch;?><br />
                            粉丝:<a href=""><?php echo $hearts;?></a><br />
                        </div>
                    </div>
                    <div class="operbox">
                        <ul>
                            <li>
                                <a class="i_mail" href="show.php?id=<?php echo $sid;?>">
                                    发送消息
                                </a>
                            </li>
                            <div class="clear">
                            </div>
                        </ul>
                        <div class="clear">
                        </div>
                    </div>
                </div>
                <div id="canvas">
                    <div id="content">
                        <div class="pageheader">
                            <h2>
                               <?php echo $name;?>
                            </h2>
                            <div class="right">
                                <ul class="tabs">
                                    <li class="active">
                                        <a href="#">
                                            粉丝
                                        </a>
                                    </li>
                                    <li>
                                        <a href="show.php?id=<?php echo $sid;?>">
                                            留言
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                                                <div class="catalog">
                        <?php
						if($empty != '1'){
						$favlen = count($exp_fav);
						for($i=0;$i<$favLen;$i++)
						{
						?>
                            <a title="<?php echo $nameArr[$i];?>" href="member.php?uid=<?php echo $uidArr[$i];?>">
                                <img id="item_drag" class="img" width="100px" height="100px" title="<?php echo $nameArr[$i];?>"
                                src="<?php get_avatar($uidArr[$i],middle);?>" />
                            </a>
                            <?php
							}
						}else{
							echo "暂时没有粉丝!";
						}
						    ?>
                            <div class="clear">
                            </div>
                        </div>
                    </div>
                </div>

<div class="clear"></div></div></div> <?php include_once("footer.template");?>
</body>
</html>